﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebAppTest
{
    public partial class _Default : System.Web.UI.Page
    {
        public int num = 1;
        protected void Page_Load(object sender, EventArgs e)
        {

            if (!Page.IsPostBack)
            {
                Response.Write("<script>alert('sdgs')</script>");

                TextBox2.Text = DropDownList1.Items[0].Value;
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (num <=  0)
            {
                Page_Load(sender, e);
            }
            else
            { 
            //Response.Write("<script>alert('refresh')</script>");
            }
        }

        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            TextBox2.Text = DropDownList1.SelectedItem.Value;
            //Response.Write("<script>alert('index_change')</script>");
        }
    }
}
